package com.javabynataraj.dbcon;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBConnection {
	
	public static Connection dbConn(){
	
		Connection conn = null;
		  String url = "jdbc:mysql://192.168.1.101:3306/";
		  String dbName = "TEST";
		  String driver = "com.mysql.jdbc.Driver";
		  String userName = "test"; 
		  String password = "test";
		  try {
		  Class.forName(driver).newInstance();
		  conn = DriverManager.getConnection(url+dbName,userName,password);
		  System.out.println("Connected to the database");
		  
//		  System.out.println("Disconnected from database");
		  } catch (Exception e) {
		  e.printStackTrace();
		  }
	return conn;
	}
}
